//
//  ZJPickerViewController.swift
//  ZJImagePicker
//
//  Created by micheal on 2018/4/4.
//  Copyright © 2018年 covermedia. All rights reserved.
//

import UIKit

class ZJPickerViewController: ZJBaseViewController {

    var assetArray = [ZJPHAsset]()
    lazy var collectionView: UICollectionView = {
        let colView = UICollectionView.init(frame: self.view.frame, collectionViewLayout: UICollectionViewFlowLayout.init())
        colView.dataSource = self
        colView.delegate = self
        colView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
        return colView
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    override func setupUI() {
        super.setupUI()
        view.backgroundColor = UIColor.white
        // 设置collectionView
        view.addSubview(collectionView)
    }
}

extension ZJPickerViewController: UICollectionViewDelegate, UICollectionViewDataSource {
    
    func numberOfSections(in collectionView: UICollectionView) -> Int {
        return 1
    }
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        
        return 10
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
        cell.contentView.backgroundColor = UIColor.red
        return cell
        
    }
}
